package com.example.administrator.exkotlin.jetpack.workmanager.work

import android.content.Context
import android.util.Log
import androidx.work.Worker
import androidx.work.WorkerParameters
import kotlin.concurrent.thread

/**
 * Author by lp,on 2020/11/19/019,17:38.
 */
//work 集成worker并调用构造函数，实现dowork方法
class SimpleWork(context: Context, params: WorkerParameters) : Worker(context, params) {

    private val TAG = "SimpleWork"
    override fun doWork(): Result {
        Log.i(TAG, "SimpleWork--start")
        Thread.sleep(1000)
        Log.i(TAG, "SimpleWork--end")
        return Result.success()
    }

}